package com.jsb.laundry.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 订单表
 * @TableName jsb_orders
 */
@TableName(value ="jsb_orders")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "JsbOrders对象",description = "订单数据")
public class JsbOrders implements Serializable {

    @ApiModelProperty(value = "订单id", dataType = "string")
    private String orderId;

    @ApiModelProperty(value = "用户id", dataType = "string")
    private String userId;

    @ApiModelProperty(value = "小站id", dataType = "string")
    private String shopId;

    @ApiModelProperty(value = "站点类型：1普通小站；2旗舰店", dataType = "int")
    private Integer shopType;

    @ApiModelProperty(value = "订单类型：1普通订单；2活动订单")
    private String orderType;

    @ApiModelProperty(value = "快递方式：1 小哥；2 顺丰", dataType = "int")
    private String shippingType;
    @ApiModelProperty(value = "邮费")
    private Integer shippingPrice;

    @ApiModelProperty(value = "商品名称", dataType = "string")
    private String ordersName;


    @ApiModelProperty("商品图片")
    private String ordersImg;

    @ApiModelProperty(value = "商品总数量", dataType = "int")
    private int num;

    @ApiModelProperty(value = "子订单量", dataType = "int")
    private int orderNumber;

    @ApiModelProperty(value = "订单状态")
    private String orderStatus;

    @ApiModelProperty(value = "子订单所有商品的总价", dataType = "int")
    private int totalItemsPrice;

    @ApiModelProperty(value = "订单总价", dataType = "int")
    private int totalPrice;

    @ApiModelProperty(value = "实际支付价格", dataType = "int")
    private int paidPrice;

    @ApiModelProperty(value = "优惠金额", dataType = "int")
    private int discountPrice;

    @ApiModelProperty(value = "是否有退款：0没有；1有", dataType = "int")
    private int hasRefund;

    @ApiModelProperty(value = "是否使用优惠券：0没有；1有", dataType = "int")
    private int hasUsedVoucher;

    @ApiModelProperty(value = "优惠券id", dataType = "string")
    private String voucherId;

    @ApiModelProperty(value = "是否包发货:0没有；1有", dataType = "int")
    private int isSplit;

    @ApiModelProperty(value = "是否评价:0没有；1有", dataType = "int")
    private int isComment;
//
//    @ApiModelProperty(value = "活动id", dataType = "string")
//    private String activityId;

    @ApiModelProperty(value = "备注", dataType = "string")
    private String note;

    @ApiModelProperty(value = "订单取消时间", dataType = "date")
    private Date cancelledAt;

    @ApiModelProperty(value = "取消原因", dataType = "string")
    private String cancelReason;

    @ApiModelProperty(value = "取消类型  user:用户；system:系统", dataType = "String")
    private String cancelType;

    @ApiModelProperty(value = "成功支付时间", dataType = "date")
    private Date paidAt;

    @ApiModelProperty(value = "订单完成时间（用户点击了确认收货或系统7天后自动完成）", dataType = "date")
    private Date successAt;

    @ApiModelProperty(value = "洗完后派件完成时间", dataType = "date")
    private Date deliveryAt;

    @ApiModelProperty(value = "订单来源：1聚洗衣；2骑手端；3旗舰店", dataType = "int")
    private String orderSource;

    @ApiModelProperty(value = "订单物流方向，1 取；2 送", dataType = "int")
    private String orderDirection;

    @ApiModelProperty(value = "创建时间", dataType = "date")
    private Date createdAt;

    @ApiModelProperty(value = "更新时间", dataType = "date")
    private Date updatedAt;
    // 删除标识( 0:正常，1:删除 )
    private String delFlag;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "支付超时时间用于30分钟取消订单")
    private Date payTimeoutAt;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "上门预约时间", dataType = "date")
    private Date appointmentTime;
    private String appointmentTimeStr;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户取件地址", hidden = true)
    private JsbOrdersShippingAddresses userAddress;

    @ApiModelProperty(value = "子订单列表", hidden = true)
    private List<JsbOrdersItem> subOrderList;


    private double distance;
    private String shopIdOrFactoryId;
}